Documentation
The Documentation section will cover everything you need to know regarding Emerald AI. What is Emerald AI? Emerald AI is an easy to use, all in one, AI system that creates dynamically wandering animals, predator and prey, enemies, NPCs, breedable animals, and more. With the behavior system, you choose if the AI is Cowardly, Passive, Hostile, or Defensive. With Emerald's easy to use Editor, it only takes few minutes to setup custom models. All AI using Emerald will have dynamically generated waypoints. These waypoints allow the AI to dynamically roam, hunt, form herds and packs, and graze all within their appropriate Radii. Emerald offers 100+ customizable options allowing you to create the perfect AI to suit your game's needs. Getting Started We recommend testing the demo scenes first. This will allow you to see Emerald AI in action. Once you have tested the demo scenes, you can start to tweak or adjust them settings to start to familiarize yourself with the Editor. Testing out the Demo Scenes If you'd like to see Emerald in action, you can test out the Demo Scenes we have provided. Emerald offers the option to enable or disable animations while using Emerald. This is perfect for if you don't have proper fully animated characters, or if you are using cubes as place holders. If you would like to become more familiar with the Emerald AI Editor, you can adjust various settings within the Editor to see the changes in the AI. Creating your own AI using Emerald If you are ready to create your own Emerald AI, then we will explain exactly how to do so. It's simple and only takes the click of a button and a few seconds. 1) Select the model you want Emerald AI to be applied to. If the model has animations, you need to make sure that that's the game object that is selected. 2) Go to Windows>Emerald - Animal AI>Create>Create AI. This will automatically apply everything that's needed to make the AI function properly. You will notice that colored radii have been added around your object you applied Emerald AI to. You can ignore these because they are normal and apart of Emerald. Note: You will need to have an active gameobject selected to use the Create AI tool. 3) If your model has animations, you will need to do this step to have animations work properly. If you don't have animations on your model, Emerald will automatically disable animations for you. Scroll down to bottom of the Emerald AI Editor. You will notice a series of animation slots. You will need to properly add your animations to these slots. 4) After you have properly applied all your Animation Names to Emerald, you will need to use the NavMesh System to Bake the mesh where the AI can walk, if you haven't already done so. If you don't know where the Navigation Tab is, go to Windows>Navigation. This will open up the Navigation tab that is needed to Bake the NavMesh for your scene. You will need to make sure that anything you want walkable by the AI is marked as Static. This allows the NavMesh to know what's walkable, and what isn't. If you don't know how to mark an object as Static, in can be found at the top right corner of the Inspector of that game object. After you have marked everything you want walkable as Static, you can open up the Navigation Tab and start the Baking process. Depending on how complex your scene is, it can take a few seconds, or quite a few minutes. So, it's best to start off on a small test scene. 5) After you have finished Baking your scene, you can now see your Animal AI in action! Play the scene, watch your AI start generating their waypoints, and then move to them. From here, you can tweak multiple settings to affect the way your AI act. If you receive any errors, go back through the steps and insure that you didn't miss anything. These will most likely be due to not properly naming your animations names correctly. Below, we will discuss the various Editor settings and options. The Emerald AI Editor The Emerald Editor has been designed to allow users to pick it up fast with a low leraning curve. Everything is pretty straight forward. Each option has its own tab. Selecting each tab will only allow you to view the options assosiated with that option. We have broken down each option into a separate category here on the Wiki. We will explain each one along with each of the vairables that you can adjust. AI Info At the top Editor of the selected AI, you will see AI Info. This shows the important stats of your AI such as its Name, Health, Type, Damage, Aggression, and more. These settings are associated with what you set your AI to have in the Editor. The values cannot be modified in this location. They are simply a visual reference for your convenience. Behavior Options The Behavior Options allow you to control your AI's behavior. Herd Options The Herd Options controls all herd related settings. Emerald's herd system allows AI to dynamically form herds and packs. AI must have matching Animal/NPC Types in order for the system to work. Attack Options The Attack Options controls any attack related options such as Damage, Attack Speed, and more. 'Health Options' The Health Options controls everything health related to your AI. 'Sound Options' The Sound Options allow you to control all sound related options for your AI such as Attack Sounds, Injured Sounds, Running Sounds, and more. 'Pathfinding Options' The pathfinind options gives you control over pathfinding related tools such as visible waypoints. Range Options (Hostile and Defensive) The range options allow you to adjust the AI's ranges for things like fleeing, attacking, stopping, and more. Range Options (Cowardly and Passive) The range options allow you to adjust the AI's ranges for things like fleeing, attacking, stopping, and more. Animation Options (Legacy) The Animation Options give you control over all Legacy animations. Simple drag and drop animations you'd like to use in the appropriate slots and the system will use them for the selected animations. Animation Options (Mecanim) The Animation Options for Mecanim work a little differently. The automatic setup system for the Emerald Editor automatically creates an Animator Controller, creates all needed states and parameters, and assigns it to the selected AI model. (Users will need to manually assign their animations using the Animator) A guide on setting up is covered below. Setting Up with Mecanim * Step 1) First, you will need to create an Animator Controller using the button at the button of the Animation Options. The Create Animator Controller button will automatically creates an Animator Controller, creates all needed states and parameters, and assigns it to the selected AI model. After creating an Animator Controller, the Edit Animator Control button will become available. * Step 2) Clicking on the Edit Animator Controller button will open up the Animator window allowing you to assign the animations for each state. * Step 3) It is important that you apply an Animation (Motion) to each state that you are using. Not doing so will result in an error and warning messages. 1 Grazing, 1 Idle, 1 Attack (Hotsile/Definsive Only), 1 Idle Comabt (Hotsile/Definsive Only),' 1 Walk, 1 Run, and 1 Die (If enabled) animations are required.' * Step 4) The extra animation options wil be exaplained below such as additional Graze and Attack animations, the Hit animation, and the Run Attack animation. Movement Options Here you can adjust the speeds that your AI will use. This AI system uses a NavMesh Agent, which is applied automatically. These speeds will change the NavMesh Agent's speed when a AI goes into Flee or Combat Mode. Tag Options In order for Emerald to work correctly, your AI will need to have a tag other than the standard Untagged. Using the Emerald Tag tab below, choose the tag that all of your Emerald AI objects will be using. This is important for Emerald so that it only detects relevant targets. Setting Up with Multi-Tags Setting up Emerald's Tags is now easier that ever. This quick guide will get you started. Make sure that you are currently on the Tag Options. * Step 1) Ensure that your Emerald AI object's tag has a tag other than Untagged. This tag should be the tag that all Emerald AI objects are using. * Step 2) Set your Emerald Tag to the tag that all your Emerald AI objects are using. * Step 3) Set your Emerald Layer to the Layer that all of your Emerald AI objects are using. Note: If your Layer is not set correctly, your AI will be unable to detect other Emerald AI objects. This is to help increase performance while searching for potential targets by only looking for relevant objects. * Optional Step 3) If your Player is a different layer, such as Player, enable Player uses Separate Layer. This will open up an additional option to set your player layer. * Step 4) Assign your AI an AI Tag. This AI Tag is what other AI will use to when looking for Tags. The AI Tag is a customized tagged created with Emerald for this specific AI. This tag doesn't use Unity's tag system, but Emerald's. This allows AI not to be dependent on Unity tags giving more freedom and flexibility for 3rd party systems and custom scripts. * Step 5 (Cowardly Only)) Using the Flee Tags, add a new tag. These tags will be the tags that make your AI flee. This tag is based on the 'AI Tag' of an AI. * Step 5 (Hostile or Defensive Only)) Using the Target Tags, add a new tag. These tags will be the tags that your AI will attack. This tag is based on the 'AI Tag' of an AI. 'Effect Options' The Effect Options allow you to control the effects that the AI makes.